package com.chuanke.ckfamily.dao.user;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.chuanke.ckfamily.dao.base.Page;
import com.chuanke.ckfamily.dao.user.model.User;
import com.weijie.core.BaseDao;

public interface UserDao extends BaseDao<User> {
	/**
	 * 查询用户的粉丝
	 * 
	 * @param param
	 * @return
	 */
	public List<User> findUserFans(@Param("param") Map<String, Object> param);

	/**
	 * 将一组用户保存至数据库
	 * 
	 * @param item
	 *            用户集合
	 */
	public void saveUsers(@Param("item") List<User> item);

	public User findByUserNo(@Param("userNo") String userNo);

	/**
	 * 根据手机号码查找用户
	 *
	 * @param param
	 * @return
	 */
	public List<User> findUserByPhone(@Param("param") Map<String, Object> param);

	/**
	 * 根据token查询
	 *
	 * @param token
	 * @return
	 */
	User findByToken(@Param("token")String token);

	public List<User> findUser(HashMap<String, Object> hashMap);

	public List<User> searchUser(@Param("param")Map<String, Object> map);

	public Integer searchFansFamilyCount(@Param("param")Map<String, Object> param);
	
	public List<Map<String, Object>> searchFansFamily(@Param("param")Map<String, Object> param, @Param("page")Page page);

	public Integer searchFansCount(@Param("param")Map<String, Object> param);
	
	public List<Map<String, Object>> searchFans(@Param("param")Map<String, Object> param, @Param("page")Page page);

	public Integer searchFriendCount(@Param("param")Map<String, Object> param);
	
	public List<Map<String, Object>> searchFriend(@Param("param")Map<String, Object> param, @Param("page")Page page);

	List<Long> findAllUserId();


}